{% extends "base.html" %}
{% load promgen %}

{% block content %}

{% breadcrumb label="Convert Farm" %}

<div class="panel panel-warning" v-pre>
  <div class="panel-heading">Error converting farm. Duplicate detected</div>

  <table class="table">
  {% for farm in farm_list %}
    <tr>
      <td>{{ farm.name }}</td>
      <td>{{ farm.source }}</td>
      <td>
        <ul>
  {% for host in farm.host_set.all %}
          <li>{{ host }}</li>
  {% endfor %}
        </ul>
      <td>
  {% if farm.id == pk %}
      <td></td>
  {% else %}
      <td>
        <form method="post" action="{% url 'farm-delete' farm.id %}" onsubmit="return confirm('Delete this farm?')" style="display: inline">
          {% csrf_token %}
          <input name="next" type="hidden" value="{{ next }}" />
          <button class="btn btn-danger">Delete</button>
        </form>
      </td>
  {% endif %}
    </tr>
  {% endfor %}
  </table>
</div>
{% endblock %}
